<template>
    <div class='sale'>
        <div class="container">
            <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" class="search-con">
                <el-form-item label="起止时间" prop="key_range">
                    <el-date-picker v-model="queryParams.key_range" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
                        value-format="yyyy-MM-dd" />
                </el-form-item>
                <el-form-item label="货号" prop="key_name">
                    <el-input v-model="queryParams.key_name" placeholder="请输入" clearable size="small" />
                </el-form-item>
                <el-form-item label="订单时间类型" prop="key_hosp_state">
                    <el-select v-model="queryParams.key_hosp_state" placeholder="请选择" clearable size="small">
                        <el-option v-for="dict in timeType" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
                    </el-select>
                </el-form-item>
                <el-form-item label="订单状态" prop="key_hosp_state">
                    <el-select v-model="queryParams.key_hosp_state" placeholder="请选择" clearable size="small">
                        <el-option v-for="dict in statusList" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
                    </el-select>
                </el-form-item>

                <el-form-item>
                    <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
                    <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
                    <el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['customer:manage:export']">导出
                    </el-button>
                </el-form-item>
            </el-form>
            <el-row :gutter="10" class="mb8">
                <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
            </el-row>
            <el-table border v-loading="loading" :data="tableList" ref="tableList" v-tableHeight :height="tableList &&tableList.length > 0 ? '900px' : '120px'">
                <el-table-column label="订单号" align="center" prop="mobile" />
                <el-table-column label="商品名称" align="center" prop="mobile" />
                <el-table-column label="货号" align="center" prop="mobile" />
                <el-table-column label="商品数量" align="center" prop="mobile" />
                <el-table-column label="订单金额" align="center" prop="mobile" />
                <el-table-column label="订单状态" align="center" prop="mobile" />
                <el-table-column label="下单时间" align="center" prop="mobile" />
                <el-table-column label="发货时间" align="center" prop="mobile" />
            </el-table>
            <pagination v-show="pageCount > 0" :pageCount="pageCount" :page.sync="queryParams.page" :limit.sync="queryParams.limit" @pagination="getList" />
        </div>
    </div>
</template>

<script>
export default {
    name: 'sale',
    components: {

    },
    data() {
        return {
            showSearch: true,
            loading: false,
            total: 0,
            pageCount: 0,
            queryParams: {
                page: 1,
                limit: 20,
                key_name: null,
            },
            tableList: [
                {}
            ],
            timeType: [{
                dictLabel: '发货时间',
                dictValue: 0
            },
            {
                dictLabel: '下单时间',
                dictValue: 1
            }],
            statusList: [
                {
                    dictLabel: '待付款',
                    dictValue: 0
                },
                {
                    dictLabel: '待发货',
                    dictValue: 1
                }, {
                    dictLabel: '已发货',
                    dictValue: 2
                },
                {
                    dictLabel: '已完成',
                    dictValue: 3
                }, {
                    dictLabel: '已关闭',
                    dictValue: 4
                }
            ]
        }
    },
    created() {

    },
    methods: {
        getList() {
            // this.loading = true;
            // getHospLists(this.queryParams).then(res => {
            //     this.tableList = res.data ? res.data.lists : [];
            //     this.pageCount = res.data.pageCount;
            //     this.loading = false;
            // });
        },
        handleQuery() {
            this.queryParams.page = 1;
            this.getList();
        },
        resetQuery() {
            this.resetForm("queryForm");
            this.handleQuery();
        },
    },
}

</script>
<style scoped lang='scss'>
</style>